<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core"
	template="/common/template.xhtml">
	<ui:define name="content">

<f:view>
	<f:loadBundle var="text" basename="#{echangeList.bundleName}" />
	<h:head>
		<title>#{text['echangeList.title']}</title>
		<meta name="heading" content="#{text['echangeList.heading']}" />
		<meta name="menu" content="EchangeMenu" />
	</h:head>
	<body id="echangeList">

		<h2>#{text['echangeList.heading']}</h2>

		<p>#{text['echangeList.message']}</p>

		<h:form id="editEchange">

			<p:dataTable id="echanges" var="echange"
				value="#{echangeList.echanges}" sortBy="#{echangeList.sortColumn}"
				styleClass="table table-striped table-hover"
				paginator="true" rows="15"
				paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
				rowsPerPageTemplate="15,25,50">

				<p:column headerText="#{text['echange.dateEchange']}"
					filterBy="#{echange.dateEchange}" filterMatchMode="startsWith">
					<h:outputText value="#{echange.dateEchange}" escape="true" />
				</p:column>

				<p:column headerText="#{text['echange.pharmacie']}"
					filterBy="#{echange.pharmacie.nomPharmacie}" filterMatchMode="contains">
					<h:outputText value="#{echange.pharmacie.nomPharmacie}" escape="true" />
				</p:column>

				<p:column headerText="#{text['echange.qteMedicament']}"
					filterBy="#{echange.qteMedicament}" filterMatchMode="startsWith">
					<h:outputText value="#{echange.qteMedicament}" escape="true" />
				</p:column>

				<p:column headerText="#{text['echange.typeEchange']}"
					filterBy="#{echange.typeEchange}" filterMatchMode="contains">
					<h:outputText value="#{echange.typeEchange}" escape="true" />
				</p:column>

				<p:column headerText="#{text['echange.valeurTotal']}"
					filterBy="#{echange.valeurTotal}" filterMatchMode="startsWith">
					<h:outputText value="#{echange.valeurTotal}" escape="true" />
				</p:column>
				
				<p:column width="10">
					<h:commandLink action="#{echangeForm.edit}" class="icon-pencil"
						title="#{text['button.edit']}">
						<f:param name="id" value="#{echange.id}" />
						<f:param name="from" value="list" />
					</h:commandLink>
				</p:column>

				<p:column width="10">
					<h:commandLink action="#{echangeForm.detail}"
						class="icon-eye-open" title="#{text['button.view']}">
						<f:param name="id" value="#{echange.id}" />
						<f:param name="from" value="list" />
					</h:commandLink>
				</p:column>

				<p:column width="10">
					<h:commandLink action="#{echangeForm.delete}" class="icon-trash"
						title="#{text['button.view']}">
						<f:param name="id" value="#{echange.id}" />
						<f:param name="from" value="list" />
					</h:commandLink>
				</p:column>
			</p:dataTable>
		</h:form>
	</body>
</f:view>
</ui:define>
</ui:composition>
